﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin.aspx.cs" Inherits="Mitc.Portal.Webs.Layouts.Quantri.Admin"  %>


<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head id="Head1" runat="server">
    <title>Quản trị hệ thống</title>

    <script type="text/javascript">
        var addTab = function (tabPanel, id, url, title) {
            var tab = tabPanel.getComponent(id);
            if (!tab) {
                tab = tabPanel.add({
                    id: id,
                    title: title,
                    closable: true,
                    autoLoad: {
                        showMask: true,
                        url: url,
                        mode: "iframe",
                        maskMsg: "Loading " + title + "..."
                    }
                });
            }

            tabPanel.setActiveTab(tab);
        }

        var ShowFullPopup = function (url, title) {
            // alert(url);
            this.Contextmenu.hide();
            FullPopup.setTitle(title);
            FullPopup.autoLoad.url = url;
            FullPopup.reload();
            FullPopup.show();

        };

        var CloseFullWindow = function () {
            FullPopup.hide();
        }
    </script>

    <style type="text/css">
        .linkButtonMess {
            margin: 10px 20px;
            color: Red;
        }

        .linkButton {
            margin: 10px 20px;
        }

        #pnlMenu {
            padding-left: 5px;
            padding-right: 5px;
            background-color: White;
        }

        .x-menu-list-item, .x-panel-header, .x-tree-node {
            font: 13px tahoma,arial,verdana,sans-serif;
        }

        .x-menu-item-text {
            font: 13px tahoma,arial,verdana,sans-serif;
            color: #123456;
        }

        .x-small-editor .x-form-field {
            font-size: 13px;
        }

        .x-label-value {
            font-size: 10px;
            color: #949494;
        }

        .ext-webkit .x-small-editor .x-form-field {
            font: 13px tahoma,arial,verdana,sans-serif;
        }

        .CVDi, .x-toolbar SPAN {
            font: bold 13px tahoma,arial,verdana,sans-serif;
            color: #123456;
        }

        a {
            text-decoration: none;
        }

        .CVDi:hover {
            text-decoration: underline;
        }

        .x-panel-noborder .x-panel-tbar-noborder .x-toolbar {
            border-top: 1px solid #AEAEA2;
            border-left: 1px solid #AEAEA2;
            border-right: 1px solid #AEAEA2;
        }

        .x-tree-node a span, .x-dd-drag-ghost a span {
            font: 13px tahoma,arial,verdana,sans-serif;
            color: #123456;
        }

        .x-menu-list-item, .x-panel-header, .x-tree-node {
            background-color: #F0F0F0;
        }

        .red {
            color: Red;
        }

        #ext-gen18 {
            overflow: hidden;
        }

        #pnlCenter {
            border-top: solid 1px #D0D0D0;
        }

            #pnlCenter .x-panel-header {
                display: none;
            }
    </style>
</head>

<body>
    <form runat="server" id="form1">
        <ext:ResourceManager runat="server" ID="MasterResouce" IDMode="Inherit"
            ScriptAdapter="Ext"
            SourceFormatting="false" RenderStyles="Embedded" CleanResourceUrl="false"
            AjaxViewStateMode="Enabled" Locale="vi-VN" RethrowAjaxExceptions="false"
            EnableTheming="false">
        </ext:ResourceManager>
        <asp:Literal ID="LtLogoCSS" runat="server"></asp:Literal>
        <ext:Viewport ID="Viewport1" runat="server" Layout="border">
            <Items>
                <ext:BorderLayout ID="btnpanel" runat="server">
                    <East>
                        <ext:Panel ID="Panel2"
                            runat="server"
                            Region="West"
                            Width="250"
                            Height="700"
                            Header="false"
                            Collapsible="true"
                            Split="true"
                            CollapseMode="Mini"
                            Margins="0 0 4 4"
                            Border="false">
                            <Items>
                                <ext:Panel ID="Panel4" runat="server"  Height="385"   Layout="AccordionLayout">
                                    <Items>
                                        <ext:TreeGrid ID="TreePanel2" runat="server" Height="200" Title="Quản trị kênh tin" RootVisible="false">
                                            <Columns>
                                                <ext:TreeGridColumn Width="230" DataIndex="CatName"  />
                                                <ext:TreeGridColumn Hidden="true" Width="230" DataIndex="SiteId" />
                                            </Columns>
                                            <Root>
                                            </Root>
                                            <Listeners>
                                                <ContextMenu Handler="#{Contextmenu}.node = node; #{Contextmenu}.showAt(e.getPoint());" />
                                                <Click Handler="addTab(#{ExampleTabs},node.attributes.SiteId,'newsList.aspx?sId='+node.attributes.SiteId,node.attributes.CatName)" />
                                            </Listeners>
                                          <BottomBar>
                                              <ext:Toolbar ID="toolsbar" runat="server">
                                                 <Items>
                                                     <ext:Button ID="btncatcr" runat="server" Icon="Add" ToolTip="Thêm mới kênh tin">
                                                       
                                                     </ext:Button>
                                                 </Items>
                                              </ext:Toolbar>
                                          </BottomBar>
                                        </ext:TreeGrid>                                        
                                        <ext:TreePanel ID="TreePanel4" runat="server" Height="200" Title="Kế hoạch công việc" RootVisible="false">
                                            <Root>
                                                <ext:TreeNode Text="Root">
                                                    <Nodes>
                                                        <ext:TreeNode Text="Lịch công tác lãnh đạo">
                                                            <Listeners>
                                                                <Click Handler="addTab(#{ExampleTabs},'lichld','CalList.aspx?type=1','Lịch công tác lãnh đạo')" />
                                                            </Listeners>

                                                        </ext:TreeNode>
                                                        <ext:TreeNode Text="Lịch họp phòng ban">
                                                            <Listeners>
                                                                <Click Handler="addTab(#{ExampleTabs},'Lichph','CalList.aspx?type=2','Lịch họp phòng ban')" />
                                                            </Listeners>
                                                        </ext:TreeNode>
                                                        <ext:TreeNode Text="Lịch xe, máy quay">
                                                            <Listeners>
                                                                <Click Handler="addTab(#{ExampleTabs},'lichmayquay','CalList.aspx?type=3','Lịch xe, máy quay')" />
                                                            </Listeners>
                                                        </ext:TreeNode>
                                                        <ext:TreeNode Text="Lịch kỹ thuật">
                                                            <Listeners>
                                                                <Click Handler="addTab(#{ExampleTabs},'lichkythuat','CalList.aspx?type=4','Lịch kỹ thuật ')" />
                                                            </Listeners>
                                                        </ext:TreeNode>
                                                        <ext:TreeNode Text="Lịch trường quay">
                                                            <Listeners>
                                                                <Click Handler="addTab(#{ExampleTabs},'lichtruongquay','CalList.aspx?type=5','Lịch trường quay ')" />
                                                            </Listeners>
                                                        </ext:TreeNode>
                                                        <ext:TreeNode Text="Lịch trực kênh">
                                                            <Listeners>
                                                                <Click Handler="addTab(#{ExampleTabs},'lichtruckenh','CreateLich.aspx?type=5','Lịch trực kênh')" />
                                                            </Listeners>
                                                        </ext:TreeNode>
                                                    </Nodes>
                                                </ext:TreeNode>
                                            </Root>
                                        </ext:TreePanel>

                                    </Items>
                                </ext:Panel>
                            </Items>
                        </ext:Panel>
                    </East>
                    <Center>

                        <ext:TabPanel
                            ID="ExampleTabs"
                            runat="server"
                            Region="Center"
                            Margins="0 4 4 0"
                            EnableTabScroll="true"
                            MinTabWidth="85">
                            <Items>
                                <ext:Panel
                                    ID="tabHome"
                                    runat="server"
                                    Title="Danh mục chức năng"
                                    IconCls="icon-application">
                                    <AutoLoad Mode="IFrame" Url="LibraryPage.aspx" ShowMask="false" />
                                </ext:Panel>
                            </Items>

                            <Plugins>
                                <ext:TabCloseMenu ID="TabCloseMenu1" runat="server" />
                            </Plugins>
                        </ext:TabPanel>
                    </Center>
                    <North>
                        <ext:Panel runat="server" ID="pnlHeader" BodyBorder="false">
                            <Content>
                                <div id="header">
                                    <div id="logo">
                                        <h3 class="proname"></h3>
                                    </div>
                                    <div id="logo-text">
                                    </div>
                                    <div class="clear-fix">
                                    </div>
                                    <div id="menungang">
                                    </div>
                                </div>
                            </Content>
                        </ext:Panel>
                    </North>
                    <South>
                        <ext:Panel runat="server" ID="pnlFooter" BodyBorder="true">
                            <Content>
                                <div id="footerBg" sytle="position: relative;">
                                    <div id="footer">
                                        <div id="footer-logo">
                                            <a href="http://mitc.vn/" target="_blank" title="Công ty TNHH Minh Tuệ"></a>
                                        </div>
                                        <div id="footer-text">
                                            <asp:Literal ID="LtFooter" runat="server"></asp:Literal>
                                        </div>
                                    </div>
                                    <div style="position: absolute; top: 0px; right: 5px;">
                                    </div>
                                </div>
                            </Content>
                        </ext:Panel>
                    </South>
                </ext:BorderLayout>



            </Items>
        </ext:Viewport>
         <ext:Menu runat="server" ID="Contextmenu">
        <Items>
            <ext:MenuItem ID="MenuItem1" runat="server" Text="Nhập tin mới" Icon="LockAdd">
                <Listeners>
                    <Click Handler="ShowFullPopup('NewsPages.aspx?sId='+this.parentMenu.node.attributes.SiteId,this.parentMenu.node.attributes.CatName)" />
                </Listeners>
            </ext:MenuItem>
            <ext:MenuItem ID="MenuItem2" runat="server" Text="Danh sách bài đã đăng" Icon="LockBreak">
                <Listeners>
                    <Click Handler="ShowFullPopup('NewsList.aspx?sId='+this.parentMenu.node.attributes.SiteId,this.parentMenu.node.attributes.CatName)" />
                </Listeners>
            </ext:MenuItem>
        </Items>
      
    </ext:Menu>
        <ext:Window ID="FullPopup" runat="server" Title="Detail" Icon="ApplicationCascade"
            Layout="FitLayout" Height="600" Width="800px" Modal="true" Maximizable="true"
            Padding="1" AutoScroll="false" InitCenter="true" Collapsible="true" BodyStyle="background-color: #fff;"
            Maximized="true" Hidden="true">
            <AutoLoad Mode="IFrame" ShowMask="true">
            </AutoLoad>
            <Listeners>
                <Hide Fn="CloseFullWindow" />
            </Listeners>
            <LoadMask ShowMask="true" />
        </ext:Window>


    </form>

</body>
</html>
